package com.order.openfeign;

import com.example.product.Product;
import com.order.openfeign.fallback.ProductFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

// 2. 指定要访问服务的name
@FeignClient(name  = "services-product", fallback = ProductFeignFallback.class)
public interface ProductOpenfeignClient {


    // 课题： 添加@RequestHeaders注解 报错400
    @GetMapping("/product/{id}")
    Product getProductById(@PathVariable("id") Long productId);
}
